
if (typeof RockitJS == "undefined") {
    var RockitJS = new Object();
}
RockitJS.Helper = new Object();

RockitJS.Helper.Table = function () {

    this.setTableId = function(id) {

    };

    this.setColumns = function($columns) {
        
        if (!$.isArray($columns)) {
            return false;
        }
        var $tableHeader = $('<tr />').attr('class', "tableHeader");
        var $htmlRow = null;

        while($column = $columns.shift())
        {
            $htmlRow += "<th>" + $column + "</th>";
        }
        
        $tableHeader.html($htmlRow);
        $('#table').html("");
        $('#table').append($tableHeader);
    };

    this.setRows = function($rows) {

        if (!$.isArray($rows)) {
            return false;
        }

        while($row = $rows.shift())
        {
            var $tableHeader = $('<tr />').attr('class', "tableRow");
            var $htmlRow = null;

            $htmlRow = "<td>" + $row[0] + "</td>";
            $htmlRow += "<td>" + $row[1] + "</td>";
            $tableHeader.html($htmlRow);
            $('#table').append($tableHeader);
        }
    };

    this.render = function() {

    };
};